import { ComponentType } from '@/plugins/form-render/constants/component-types';
import { IGaeaSetting } from '@/plugins/form/defines/application';
// import { TRAVEL_DEFAULT_URL } from '../constants';
// 差旅费报销申请
export class Props {
  // public baseUrl = TRAVEL_DEFAULT_URL;
  // public workplaceId = TRAVEL_DEFAULT_URL.workplaceList;
  // public travelPlanId = TRAVEL_DEFAULT_URL.travelPlanList;
  // public travelPlanDetailsId = TRAVEL_DEFAULT_URL.travelPlanDetails;
  public form?: any;
  public renderMode?: string;
  public name?: string;
  public setChildHandlers?: (params: any) => void;

  public editSetting: IGaeaSetting = {
    key: 'gaea-group-online-official',
    name: 'GroupOfficialOnline',
    isGroup: true,
    grouping: 'laborType',
    // editors: TRAVEL_COST_EDITORS,
    defaultEvents: [
      // 监听-关联项目编号点击触发
      {
        trigger: {
          type: 'subscribe',
          name: 'gaea_relateProject_change'
        },
        action: {
          type: 'childHandler',
          field: 'onRelateProjectChange'
        }
      }
    ],
    components: [
      {
        key: ComponentType.Card,
        props: { title: '基础信息' },
        components: [
          {
            key: ComponentType.DeptSelect,
            props: {
              name: '部门',
              code: 'orgId',
              required: true,
              type: 'modal'
            },
            defaultEvents: [
              {
                trigger: {
                  type: 'callback',
                  field: 'onOrgChange'
                },
                action: {
                  type: 'emit',
                  name: 'gaea_relateProject_change'
                }
              }
            ]
          }
        ]
      }
    ]
  };

  public children: React.ReactElement[] = [];
  public formValues?: any;
}

export class State {
  matterIdList?: any[];
}
